<?php
/**
 * Filename: StarBuzzCoffe.php
 * 星巴克咖啡，测试
 */

/**
 * 重写 __autoload 方法
 *
 * @param string $class
 */
function __autoload($class_name) {
	include_once $class_name.'.php'; 
} //END func __autoload

//要一杯浓缩咖啡
$beverage = new Espresso();
echo "<br />只要浓缩咖啡，那么价钱是：".$beverage->cost();
echo "<br />您的清单是: ".$beverage->getDescription();

//再来一杯混合咖啡
$beverage2 = new HouseBlend();
echo "<br /><br />混合咖啡的单价：".$beverage2->cost();

$beverage2 = new Mocha($beverage2); //加 摩卡
echo "<br />加了 摩卡 后: ".$beverage2->cost();

$beverage2 = new Soy($beverage2);
echo "<br />加了 豆浆 后: ".$beverage2->cost();

$beverage2 = new Whip($beverage2);
echo "<br />加了 奶泡 后: ".$beverage2->cost();
echo "<br />你的清单: ".$beverage2->getDescription();
?>